/*  N5110 Class
*   Library for interfacing with Nokia 5110 LCD display (https://www.sparkfun.com/products/10168) using the hardware SPI on the mbed.
*   The display is powered from a GPIO pin meaning it can be controlled via software.  The LED backlight is also software-controllable (via PWM pin).
*   Can print characters and strings to the display using the included 5x7 font.
*   The library also implements a screen buffer so that individual pixels on the display (84 x 48) can be set, cleared and read.
*   The library can print primitive shapes (lines, circles, rectangles)
*   Acknowledgements to Chris Yan's Nokia_5110 Library.
*
*   Revision 1.3
*   Author: Craig A. Evans 7th February 2017
*   Editied by: Andrew Knowles 2021
*   Update by: Dr Tim Amsdon Feb 2022 -> Added SPI Mode selection required for different LCD variants
*/

#ifndef N5110_H
#define N5110_H

#include "mbed.h"

// number of pixels on display
#define WIDTH 84
#define HEIGHT 48
#define BANKS 6

/// Fill types for 2D shapes
enum FillType {
    FILL_TRANSPARENT, ///< Transparent with outline
    FILL_BLACK,       ///< Filled black
    FILL_WHITE,       ///< Filled white (no outline)
};

/// Nokia 5510 LCD types -> Added by Dr Tim Amsdon Feb 2022
enum LCD_Type {
    LPH7366_6, ///< Nokia 5510 part no. LPH7366-6 (check back of LCD module) uses SPI Mode 1
    LPH7366_1, ///< Nokia 5510 part no. LPH7366-1 (check back of LCD module) uses SPI Mode 0
};

class N5110{
private:
// objects
    SPI         *_spi;
    PwmOut      *_led;
    DigitalOut  *_pwr;
    DigitalOut  *_sce;
    DigitalOut  *_rst;
    DigitalOut  *_dc;

// variables
    unsigned char buffer[84][6];  // screen buffer - the 6 is for the banks - each one is 8 bits;

public:
    //Create a N5110 object connected to the specified pins
    N5110(PinName const pwrPin, //Pin connected to Vcc on the LCD display
          PinName const scePin, //Pin connected to chip enable
          PinName const rstPin, //Pin connected to reset
          PinName const dcPin,  //Pin connected to data/command select
          PinName const mosiPin,//Pin connected to data input (MOSI)
          PinName const sclkPin,//Pin connected to serial clock (SCLK)
          PinName const ledPin);//Pin connected to LED backlight (must be PWM)

    //Create a N5110 object connected to the specified pins (Vcc to +3V3)
    N5110(PinName const scePin, //Pin connected to chip enable
          PinName const rstPin, //Pin connected to reset
          PinName const dcPin,  //Pin connected to data/command select
          PinName const mosiPin,//Pin connected to data input (MOSI)
          PinName const sclkPin,//Pin connected to serial clock (SCLK)
          PinName const ledPin);//Pin connected to LED backlight (must be PWM)

    //Free allocated memory when object goes out of scope
    ~N5110();

    /* Initialise display
    *   Powers up the display and turns on backlight (50% brightness default).
    *   Sets the display up in horizontal addressing mode and with normal video mode.
    *   LCD type is passed to enable SPI mode modification -> functionality added byt Dr Tim Amsdon Feb 2022*/
    void init(LCD_Type const lcd);

    /* Turn off
    *   Powers down the display and turns of the backlight.
    *   Needs to be reinitialised before being re-used.*/
    void turnOff();

    /* Clear
    *   Clears the screen buffer.*/
    void clear();

    /* Set screen constrast
       @param constrast - float in range 0.0 to 1.0 (0.40 to 0.60 is usually a good value)*/
    void setContrast(float contrast);
    
    // Turn on normal video mode (default) Black on white
    void normalMode();

    // Turn on inverse video mode (default) White on black
    void inverseMode();

    /* Set Brightness
    *   Sets brightness of LED backlight.
    *   @param brightness - float in range 0.0 to 1.0*/
    void setBrightness(float const brightness);

    /* Print String
    *   Prints a string of characters to the screen buffer. String is cut-off after the 83rd pixel.
    *   @param x - the column number (0 to 83)
    *   @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row*/
    void printString(char const *str, unsigned int const  x, unsigned int const  y);

    /* Print Character
    *   Sends a character to the screen buffer.  Printed at the specified location. Character is cut-off after the 83rd pixel.
    *   @param  c - the character to print. Can print ASCII as so printChar('C').
    *   @param x - the column number (0 to 83)
    *   @param y - the row number (0 to 5) - the display is split into 6 banks - each bank can be considered a row*/
    void printChar(char const c, unsigned int const x, unsigned int const y);

    /* Set a Pixel
    * @param x     The x co-ordinate of the pixel (0 to 83)
    * @param y     The y co-ordinate of the pixel (0 to 47)
    * @param state The state of the pixel [true=black (default), false=white]
    * @details This function sets the state of a pixel in the screen buffer.
    *          The third parameter can be omitted*/
    void setPixel(unsigned int const x,
                  unsigned int const y,
                  bool const         state = true);

    /* Clear a Pixel
    *   @param  x - the x co-ordinate of the pixel (0 to 83)
    *   @param  y - the y co-ordinate of the pixel (0 to 47)
    *   @details This function clears pixel in the screen buffer
    *   @deprecated Use setPixel(x, y, false) instead*/
    void clearPixel(unsigned int const x,
                    unsigned int const y)
    __attribute__((deprecated("Use setPixel(x,y,false) instead")));

    /* Get a Pixel
    *   This function gets the status of a pixel in the screen buffer.
    *   @param  x - the x co-ordinate of the pixel (0 to 83)
    *   @param  y - the y co-ordinate of the pixel (0 to 47)
    *   @returns
    *       0           - pixel is clear
    *       1    - pixel is set*/
    int getPixel(unsigned int const x, unsigned int const y) const;

    /* Refresh display
    *   This functions sends the screen buffer to the display.*/
    void refresh();

    /* Randomise buffer
    *   This function fills the buffer with random data.  Can be used to test the display.
    *   A call to refresh() must be made to update the display to reflect the change in pixels.
    *   The seed is not set and so the generated pattern will probably be the same each time.
    *   TODO: Randomise the seed - maybe using the noise on the AnalogIn pins.*/
    void randomiseBuffer();

    /* Plot Array
    *   This function plots a one-dimensional array in the buffer.
    *   @param array[] - y values of the plot. Values should be normalised in the range 0.0 to 1.0. First 84 plotted.*/
    void plotArray(float const array[]);

    /* Draw Circle
    *   This function draws a circle at the specified origin with specified radius in the screen buffer
    *   Uses the midpoint circle algorithm.
    *   @see http://en.wikipedia.org/wiki/Midpoint_circle_algorithm
    *   @param  x0     - x-coordinate of centre
    *   @param  y0     - y-coordinate of centre
    *   @param  radius - radius of circle in pixels
    *   @param  fill   - fill-type for the shape*/
    void drawCircle(unsigned int const x0, unsigned int const y0, unsigned int const radius, FillType const fill);

    /* Draw Line
    *   This function draws a line between the specified points using linear interpolation.
    *   @param  x0 - x-coordinate of first point
    *   @param  y0 - y-coordinate of first point
    *   @param  x1 - x-coordinate of last point
    *   @param  y1 - y-coordinate of last point
    *   @param  type - 0 white,1 black,2 dotted*/
    void drawLine(unsigned int const x0, unsigned int const y0, unsigned int const x1, unsigned int const y1, unsigned int const type);

    /* Draw Rectangle
    *   This function draws a rectangle.
    *   @param  x0 - x-coordinate of origin (top-left)
    *   @param  y0 - y-coordinate of origin (top-left)
    *   @param  width - width of rectangle
    *   @param  height - height of rectangle
    *   @param  fill   - fill-type for the shape*/
    void drawRect(unsigned int const x0, unsigned int const y0, unsigned int const width, unsigned int const height, FillType const fill);

    /* Draw Sprite
    *   This function draws a sprite as defined in a 2D array
    *   @param  x0 - x-coordinate of origin (top-left)
    *   @param  y0 - y-coordinate of origin (top-left)
    *   @param  nrows - number of rows in sprite
    *   @param  ncols - number of columns in sprite
    *   @param  sprite - 2D array representing the sprite*/
    void drawSprite(int x0, int y0, int nrows, int ncols, int *sprite);

    void invertLine(unsigned int y);

    void draw_role(int x0, int y0, char direction, int level);
    
    void draw_element(int x0, int y0, int type);  

    void draw_heart(int x0, int y0,char state);

    void drawBitmap(int x0, int y0, int width, int height, const uint8_t *bitmap);

    void show_cover(void);

    void lev_up_gif(int x0, int y0);

    void show_weapon(int x0, int y0);

    void draw_arrow(int x_start, int y_start, int x_end, int y_end);

    void draw_joystick(int x0, int y0);

    void draw_encoder(int x0, int y0);

    void draw_key(int x0, int y0);

    void draw_cup(int x0, int y0);

private:
// methods
    void setXYAddress(unsigned int const x,
                      unsigned int const y);
    void initSPI(LCD_Type const lcd); // LCD type is passed to enable SPI mode modification -> functionality added byt Dr Tim Amsdon Feb 2022
    void turnOn();
    void reset();
    void clearRAM();
    void sendCommand(unsigned char command);
    void sendData(unsigned char data);
    void setTempCoefficient(char tc);           // 0 to 3
    void setBias(char bias);                    // 0 to 7
};

const unsigned char font5x7[480] = {
    0x00, 0x00, 0x00, 0x00, 0x00,// (space)
    0x00, 0x00, 0x5F, 0x00, 0x00,// !
    0x00, 0x07, 0x00, 0x07, 0x00,// "
    0x14, 0x7F, 0x14, 0x7F, 0x14,// #
    0x24, 0x2A, 0x7F, 0x2A, 0x12,// $
    0x23, 0x13, 0x08, 0x64, 0x62,// %
    0x36, 0x49, 0x55, 0x22, 0x50,// &
    0x00, 0x05, 0x03, 0x00, 0x00,// '
    0x00, 0x1C, 0x22, 0x41, 0x00,// (
    0x00, 0x41, 0x22, 0x1C, 0x00,// )
    0x08, 0x2A, 0x1C, 0x2A, 0x08,// *
    0x08, 0x08, 0x3E, 0x08, 0x08,// +
    0x00, 0x50, 0x30, 0x00, 0x00,// ,
    0x08, 0x08, 0x08, 0x08, 0x08,// -
    0x00, 0x60, 0x60, 0x00, 0x00,// .
    0x20, 0x10, 0x08, 0x04, 0x02,// /
    0x3E, 0x51, 0x49, 0x45, 0x3E,// 0
    0x00, 0x42, 0x7F, 0x40, 0x00,// 1
    0x42, 0x61, 0x51, 0x49, 0x46,// 2
    0x21, 0x41, 0x45, 0x4B, 0x31,// 3
    0x18, 0x14, 0x12, 0x7F, 0x10,// 4
    0x27, 0x45, 0x45, 0x45, 0x39,// 5
    0x3C, 0x4A, 0x49, 0x49, 0x30,// 6
    0x01, 0x71, 0x09, 0x05, 0x03,// 7
    0x36, 0x49, 0x49, 0x49, 0x36,// 8
    0x06, 0x49, 0x49, 0x29, 0x1E,// 9
    0x00, 0x36, 0x36, 0x00, 0x00,// :
    0x00, 0x56, 0x36, 0x00, 0x00,// ;
    0x00, 0x08, 0x14, 0x22, 0x41,// <
    0x14, 0x14, 0x14, 0x14, 0x14,// =
    0x41, 0x22, 0x14, 0x08, 0x00,// >
    0x02, 0x01, 0x51, 0x09, 0x06,// ?
    0x32, 0x49, 0x79, 0x41, 0x3E,// @
    0x7E, 0x11, 0x11, 0x11, 0x7E,// A
    0x7F, 0x49, 0x49, 0x49, 0x36,// B
    0x3E, 0x41, 0x41, 0x41, 0x22,// C
    0x7F, 0x41, 0x41, 0x22, 0x1C,// D
    0x7F, 0x49, 0x49, 0x49, 0x41,// E
    0x7F, 0x09, 0x09, 0x01, 0x01,// F
    0x3E, 0x41, 0x41, 0x51, 0x32,// G
    0x7F, 0x08, 0x08, 0x08, 0x7F,// H
    0x00, 0x41, 0x7F, 0x41, 0x00,// I
    0x20, 0x40, 0x41, 0x3F, 0x01,// J
    0x7F, 0x08, 0x14, 0x22, 0x41,// K
    0x7F, 0x40, 0x40, 0x40, 0x40,// L
    0x7F, 0x02, 0x04, 0x02, 0x7F,// M
    0x7F, 0x04, 0x08, 0x10, 0x7F,// N
    0x3E, 0x41, 0x41, 0x41, 0x3E,// O
    0x7F, 0x09, 0x09, 0x09, 0x06,// P
    0x3E, 0x41, 0x51, 0x21, 0x5E,// Q
    0x7F, 0x09, 0x19, 0x29, 0x46,// R
    0x46, 0x49, 0x49, 0x49, 0x31,// S
    0x01, 0x01, 0x7F, 0x01, 0x01,// T
    0x3F, 0x40, 0x40, 0x40, 0x3F,// U
    0x1F, 0x20, 0x40, 0x20, 0x1F,// V
    0x7F, 0x20, 0x18, 0x20, 0x7F,// W
    0x63, 0x14, 0x08, 0x14, 0x63,// X
    0x03, 0x04, 0x78, 0x04, 0x03,// Y
    0x61, 0x51, 0x49, 0x45, 0x43,// Z
    0x00, 0x00, 0x7F, 0x41, 0x41,// [
    0x02, 0x04, 0x08, 0x10, 0x20,// "\"
    0x41, 0x41, 0x7F, 0x00, 0x00,// ]
    0x04, 0x02, 0x01, 0x02, 0x04,// ^
    0x40, 0x40, 0x40, 0x40, 0x40,// _
    0x00, 0x01, 0x02, 0x04, 0x00,// `
    0x20, 0x54, 0x54, 0x54, 0x78,// a
    0x7F, 0x48, 0x44, 0x44, 0x38,// b
    0x38, 0x44, 0x44, 0x44, 0x20,// c
    0x38, 0x44, 0x44, 0x48, 0x7F,// d
    0x38, 0x54, 0x54, 0x54, 0x18,// e
    0x08, 0x7E, 0x09, 0x01, 0x02,// f
    0x08, 0x14, 0x54, 0x54, 0x3C,// g
    0x7F, 0x08, 0x04, 0x04, 0x78,// h
    0x00, 0x44, 0x7D, 0x40, 0x00,// i
    0x20, 0x40, 0x44, 0x3D, 0x00,// j
    0x00, 0x7F, 0x10, 0x28, 0x44,// k
    0x00, 0x41, 0x7F, 0x40, 0x00,// l
    0x7C, 0x04, 0x18, 0x04, 0x78,// m
    0x7C, 0x08, 0x04, 0x04, 0x78,// n
    0x38, 0x44, 0x44, 0x44, 0x38,// o
    0x7C, 0x14, 0x14, 0x14, 0x08,// p
    0x08, 0x14, 0x14, 0x18, 0x7C,// q
    0x7C, 0x08, 0x04, 0x04, 0x08,// r
    0x48, 0x54, 0x54, 0x54, 0x20,// s
    0x04, 0x3F, 0x44, 0x40, 0x20,// t
    0x3C, 0x40, 0x40, 0x20, 0x7C,// u
    0x1C, 0x20, 0x40, 0x20, 0x1C,// v
    0x3C, 0x40, 0x30, 0x40, 0x3C,// w
    0x44, 0x28, 0x10, 0x28, 0x44,// x
    0x0C, 0x50, 0x50, 0x50, 0x3C,// y
    0x44, 0x64, 0x54, 0x4C, 0x44,// z
    0x00, 0x08, 0x36, 0x41, 0x00,// {
    0x00, 0x00, 0x7F, 0x00, 0x00,// |
    0x00, 0x41, 0x36, 0x08, 0x00,// }
    0x08, 0x08, 0x2A, 0x1C, 0x08,// ->
    0x08, 0x1C, 0x2A, 0x08, 0x08 // <-
};

//18*15
const unsigned char energy_1[36] = { /* 0X12,0X01,0X00,0X12,0X00,0X0F, */
0X00,0X00,0X00,0X00,0X03,0X07,0X0F,0X0F,0X1E,0X1E,0X0F,0X0F,0X07,0X03,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XF0,0XF0,0X70,0X70,0XF0,0XF0,0XC0,0X00,
0X00,0X00,0X00,0X00,};

//25*21
const unsigned char obstacle[75] = { /* 0X12,0X01,0X00,0X19,0X00,0X15, */
0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X1F,0X3F,0X38,0X3B,0X3B,0X3B,0X3B,0X3B,0X3F,
0X1F,0X0B,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,
0XDC,0XBA,0X0A,0XBA,0XBA,0XBA,0XBA,0XBA,0XBA,0XDE,0XD8,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};
// 15*15
const unsigned char heart[30] = { /* 0X12,0X01,0X00,0X0F,0X00,0X0F, */
0X00,0X00,0X00,0X00,0X01,0X03,0X07,0X0F,0X07,0X03,0X01,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0XC0,0XE0,0XF0,0XF0,0XE0,0XF0,0XF0,0XE0,0XC0,0X00,0X00,0X00,};

const int heart_over[6][6] = {
    {0,1,0,0,1,0},
    {1,0,1,1,0,1},
    {1,0,0,0,0,1},
    {0,1,0,0,1,0},
    {0,0,1,1,0,0},
    {0,0,0,0,0,0}
};

const unsigned char game_cover[504] =  { /* 0X12,0X01,0X00,0X54,0X00,0X30, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X18,0XF8,0X3F,0X3F,0X7F,0X7B,
0X7B,0X3B,0X3B,0X7B,0X7F,0X7F,0X3D,0X38,0X38,0X78,0X7A,0X7B,0X7B,0X3B,0X3B,0X3B,
0X3A,0X78,0X78,0X78,0X38,0X38,0X38,0X3A,0X3B,0X7F,0X7B,0X7B,0X3B,0X3B,0X3E,0X38,
0X78,0X78,0X7C,0X7E,0X3B,0X39,0X38,0X7F,0X7F,0X78,0X79,0X39,0X39,0X38,0X38,0X3F,
0X7F,0X79,0X78,0X38,0X3D,0X3D,0XFF,0X38,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,
0XF8,0XFE,0XFF,0XFF,0XC3,0XC1,0XDD,0XDD,0XE3,0XFE,0XFE,0X80,0X01,0X07,0X07,0X87,
0XE3,0XE3,0XF0,0XFC,0XFF,0X7F,0X3F,0X1F,0X1F,0X0F,0X0F,0X0F,0XDF,0XFF,0XFF,0XFF,
0XFC,0X78,0X11,0X01,0X03,0X06,0X31,0X39,0X99,0XF8,0XF8,0XFF,0X3F,0X47,0XC7,0XC2,
0XA0,0XD0,0X48,0X38,0X98,0XC0,0XE0,0X61,0XF8,0XE4,0X80,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XF0,0XF8,0XF8,0XFE,0XFE,0X1F,0X1F,0X1F,0XDF,0XFF,0XFE,0X7F,0X7F,0X77,0XF2,0X7A,
0XFA,0X7B,0XFA,0X7A,0X3E,0XCF,0XF0,0XFE,0X1C,0X68,0XE0,0XE0,0XFC,0X5F,0X07,0X01,
0X01,0X07,0X1C,0X18,0X08,0X0C,0X07,0X01,0X00,0X00,0X00,0X80,0X80,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,
0X03,0X03,0X03,0X03,0X01,0X00,0X03,0X03,0X00,0X00,0X80,0X81,0XB9,0X3C,0X7E,0XF0,
0XE1,0XF3,0X38,0X78,0XF8,0XF8,0XF8,0X78,0X71,0XF0,0X78,0X7E,0X3C,0X00,0X01,0X03,
0X03,0XC3,0XF3,0X39,0X98,0X73,0X33,0X23,0X23,0X23,0X20,0XF0,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X01,0X01,0X00,
0X00,0X00,0X01,0XF9,0XF9,0X68,0X68,0XF8,0XB0,0X01,0X81,0XF1,0X79,0X49,0X78,0XF8,
0XF1,0X01,0X09,0X09,0XF9,0XF8,0X18,0X09,0X09,0X01,0X09,0X09,0XF8,0XF8,0X18,0X08,
0X09,0X01,0XF8,0XF8,0X00,0X01,0X01,0X01,0X00,0XF8,0XF9,0X69,0X69,0X09,0X01,0X00,
0X01,0X01,0X01,0X00,0X00,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X58,0XFC,0XFC,
0X2C,0X2C,0X0C,0X00,0X1C,0X7C,0XE0,0X80,0XE0,0X7C,0X1C,0X00,0XF8,0XFC,0X8C,0X0C,
0XFC,0XF8,0X00,0X00,0XFC,0XFC,0X00,0X00,0X00,0X00,0XFC,0XFC,0X00,0X00,0XFC,0XFC,
0X00,0X00,0X0C,0X0C,0XFC,0XFC,0X0C,0X0C,0X00,0X40,0XFC,0XFC,0X00,0XF8,0XFC,0X0C,
0X0C,0XFC,0XF8,0X00,0XB8,0XFC,0XBC,0X30,0X60,0XE0,0XFC,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};

//24*24
const unsigned char role_level1_R[72] =  {  /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X00,0X00,0X03,0X06,0X08,0X1F,0X02,0X06,0X05,0X05,0X0F,0X0F,0X05,
0X04,0X06,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X19,0X62,0X84,0X1C,0X32,0XE1,
0XE0,0X10,0XC8,0XCC,0XC7,0XC7,0XC7,0XC4,0XC8,0XC8,0X30,0XE0,0XFF,0X66,0X3C,0X00,
0X00,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X60,0X30,0X10,0X1C,0XF6,0XF2,0XF2,0X0E,
0X10,0X10,0X20,0XC0,0X80,0X00,0X00,0X00,};

const unsigned char role_level1_L[72] =  { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X00,0X00,0X03,0X06,0X04,0X05,0X0F,0X0F,0X05,0X05,0X06,0X02,0X1F,
0X08,0X06,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X3C,0X66,0XFF,0XE0,0X30,0XC8,0XC8,
0XC4,0XC7,0XC7,0XC7,0XCC,0XC8,0X10,0XE0,0XE1,0X32,0X1C,0X84,0X62,0X19,0X07,0X00,
0X00,0X00,0X00,0X80,0XC0,0X20,0X10,0X10,0X0E,0XF2,0XF2,0XF6,0X1C,0X10,0X30,0X60,
0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X00,};

const unsigned char role_level1_up[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X01,0X00,0X00,0X00,0X00,0X00,0X01,0X06,0X0C,0X08,0X38,0X6F,0X4F,0X4F,0X70,
0X08,0X08,0X04,0X03,0X01,0X00,0X00,0X00,0X00,0XE0,0X98,0X46,0X21,0X38,0X4C,0X87,
0X07,0X08,0X13,0X33,0XE3,0XE3,0XE3,0X23,0X13,0X13,0X0C,0X07,0XFF,0X66,0X3C,0X00,
0X00,0X00,0X00,0X00,0X00,0XC0,0X60,0X10,0XF8,0X40,0X60,0XA0,0XA0,0XF0,0XF0,0XA0,
0X20,0X60,0XC0,0X00,0X00,0X00,0X00,0X00,};


//32*32
const unsigned char lev_up_frame1[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X08,0X00,0X00,0X0E,
0X0E,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char lev_up_frame2[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X08,0X0C,0X0C,0X1F,
0X1F,0X0D,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,
0XF0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char lev_up_frame3[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1C,0X0C,0X0C,0X1E,0X1F,
0X1F,0X1F,0X0F,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XFF,
0XFF,0XA0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,
0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char lev_up_frame4[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0X0C,0X5E,0X1F,0X1F,
0X1F,0X1F,0X1E,0X1F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0X00,0X40,0XC0,0XFF,
0XFF,0XE0,0X30,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,
0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char lev_up_frame5[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1F,0X1F,0X3F,0X1F,0X1F,
0X1F,0X1F,0X1F,0X1F,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF8,0XF0,0XE0,0XFC,0XFF,
0XFF,0XF8,0XF8,0XF8,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,
0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char lev_up_frame6[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0X0E,0X1F,0X1F,0X1F,
0X1F,0X1F,0X1F,0X1F,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0XFF,0XFF,
0XFF,0XFF,0XFF,0XFF,0X18,0X04,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XF0,
0XF8,0XC0,0X80,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char lev_up_frame7[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X0C,0X1F,0X1F,0X1F,
0X1F,0X1F,0X1C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XDF,0XCF,0XFF,0XFF,
0XFF,0XFF,0X7F,0X7F,0X38,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XF8,0XF8,0XF8,0XFC,
0XFE,0XFE,0XF8,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char lev_up_frame8[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0D,0X1F,0X1F,0X1E,
0X1E,0X1C,0X1C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X20,0XFF,0XDF,0X81,0X00,0X43,
0X0F,0X07,0X43,0X3F,0X30,0X18,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XF0,0XF0,0XF8,0XF8,
0XFC,0XFE,0XF8,0XFC,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char lev_up_frame9[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X1D,0X1F,0X1E,0X1C,
0X1C,0X1C,0X1C,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X40,0X83,0X8F,0X00,0X00,0X00,
0X00,0X01,0X00,0X43,0X30,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XF0,0X00,0X00,0X10,
0XFC,0XFC,0X30,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char lev_up_frame10[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X0F,0X0E,0X1C,0X1C,
0X1C,0X1C,0X0C,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X01,0X00,0X00,0XA0,
0X00,0X00,0X00,0X40,0X20,0X10,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF8,0X04,0X00,0X08,
0X10,0X0C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char NPC1[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X00,0X00,0X0F,0X3F,0X7C,0X73,0X06,0X04,0X0F,0X09,0X0B,0X0C,0X09,
0X07,0X03,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X1F,0XFE,0XF8,0XBF,0XFF,
0X3F,0X3F,0XFF,0X3F,0XFF,0X7D,0XF8,0XFF,0XFF,0XFF,0XFF,0XFF,0X78,0X00,0X00,0X00,
0X00,0XE0,0XF0,0X80,0X00,0X00,0X00,0X80,0XC0,0XF0,0XF0,0XF8,0XF8,0XF8,0X38,0X80,
0XF0,0XF0,0XE0,0X80,0X00,0X00,0X00,0X00,};

//16*25
const unsigned char weapon1[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X04,0XFF,0X87,0X84,0X78,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0XFF,0XFF,0X03,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X30,0XFF,0XFE,0XFE,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon2[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X62,0X3E,0X07,0X47,0X38,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X80,0XF0,0XFC,0X7F,0X1F,0X0F,0X03,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XF8,0XFE,0XFF,0XFE,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char weapon3[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X38,0X2F,0X23,0X33,0X0F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X80,0X80,0XC0,0XE0,0XF8,0X7C,0X3F,0X1F,0X0F,0X07,0X03,0X01,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XF0,0XF0,0XF8,0XFE,0X7E,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon4[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X09,0X08,0X07,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XC0,0XC0,0XE0,0X70,0X70,0X38,0X3C,0X1E,0X1F,0X0F,0X0F,0X07,0X03,0X01,0X01,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XE0,0XE0,0XF0,0XF8,0X7C,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char weapon5[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X38,0XF0,0X30,0X38,0X38,0X3C,0X1C,0X1E,0X1E,0X1F,0X0F,0X0F,0X0F,0X07,0X07,0X03,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XC0,0XC0,0XC0,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};


const unsigned char weapon6[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X00,0X78,0X84,0X87,0XFF,0X04,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XFF,0XFF,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0XF8,0XFE,0XFE,0XFF,0X30,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon7[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X38,0X47,0X07,0X7E,0X62,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X03,0X0F,0X1F,0X7F,0XFE,0XF0,0X80,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0XFE,0XFF,0XFE,0XF8,0XD0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon8[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0C,0X33,0X21,0X20,0X30,
0X00,0X00,0X00,0X00,0X01,0X07,0X0F,0X1F,0X3E,0X7C,0XF0,0XE0,0X80,0X00,0X80,0X00,
0X00,0X00,0X7E,0XFC,0XF8,0XF0,0XF0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon9[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X07,0X08,0X08,
0X00,0X00,0X01,0X03,0X07,0X07,0X0F,0X1E,0X1E,0X3C,0X38,0X70,0X60,0XC0,0XC0,0X40,
0X7C,0XF0,0XF0,0XE0,0XE0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

const unsigned char weapon10[64] = { /* 0X12,0X01,0X00,0X10,0X00,0X19, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,
0X03,0X07,0X07,0X0F,0X0F,0X0F,0X0E,0X1E,0X1C,0X1C,0X1C,0X38,0X38,0X30,0XF0,0X38,
0XC0,0XC0,0XC0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

//32*32
const unsigned char joystick_img[128] = { /* 0X12,0X01,0X00,0X20,0X00,0X20, */
0X00,0X00,0X00,0X00,0X01,0X03,0X07,0X07,0X0F,0X0F,0X1F,0X1F,0X3F,0X3F,0X7F,0X7F,
0X7F,0X7F,0X3F,0X3F,0X1F,0X1F,0X0F,0X0F,0X07,0X07,0X03,0X01,0X01,0X00,0X00,0X00,
0X00,0X00,0X00,0XE0,0XF0,0XF8,0XF8,0XFC,0XFC,0XFE,0XFA,0XFD,0XFD,0XE2,0XE7,0XEF,
0XE8,0XE7,0XFE,0XFC,0XF1,0XF8,0XF2,0XF0,0XF4,0XF0,0XF8,0XF8,0XF0,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X07,0X07,0XBF,0XFF,
0X0F,0XFF,0X87,0X07,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,0XF8,0XFC,0XE2,0XE2,0XF3,
0XF3,0XF2,0XF6,0XFC,0XF8,0XF0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};
//32*29
const unsigned char encoder_img[128] =  { /* 0X12,0X01,0X00,0X20,0X00,0X1D, */
0X00,0X10,0X2F,0X73,0XE3,0XFF,0XFF,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0XF7,0XFF,
0XFF,0XFF,0XFF,0XFF,0XFE,0XF8,0XE1,0XE7,0XFF,0XEF,0X7F,0X2F,0X03,0X00,0X00,0X00,
0X00,0X00,0X00,0XC0,0XE0,0XF8,0XFE,0XFF,0XFF,0XFF,0XFF,0XFD,0XF0,0XA0,0XA0,0XC0,
0XC0,0XE0,0XF1,0XF9,0XFF,0XBF,0XFF,0XFF,0XFD,0XFF,0XFF,0X7F,0XFE,0XEE,0X7F,0X1D,
0X00,0X00,0X00,0X00,0X07,0X0F,0XFF,0XFF,0XFF,0XF3,0XE3,0XE3,0XCF,0XFF,0X7E,0X3E,
0X1C,0X70,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XF0,0XA0,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0XE0,0XE0,0XE0,0XE0,0XE0,0XE0,0X80,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
};

//
const unsigned char key_img[140] = { /* 0X12,0X01,0X00,0X23,0X00,0X1E, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X7F,0X43,
0X58,0X70,0X60,0X58,0X44,0X43,0X7F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X3F,0X26,0X26,0X29,0X29,0X29,0X20,0X30,0X30,0X3F,0X00,0X00,
0X00,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X80,0X00,0X00,0X1F,0X10,0X18,0X18,
0X14,0X15,0X15,0X12,0X1F,0X00,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X40,
0X80,0X00,0X00,0X07,0X07,0X04,0X04,0X04,0X04,0X04,0X05,0X06,0X00,0X00,0X00,0XE0,
0X20,0X60,0XE0,0XA0,0X20,0X20,0X20,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0XF8,0X08,0XC8,0X38,0X08,0X38,0XC8,0X88,0X08,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};

//24*24
const unsigned char role_level2_down[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X01,0X03,0X03,0X01,0X07,0X0B,0X0D,0X0D,0X1B,0X1F,0X1D,0X0D,0X0F,
0X07,0X01,0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X07,0X1F,0XFE,0XFC,0XFC,0XFE,0XFF,
0XFF,0XFF,0XFF,0XBF,0XBF,0XFF,0XFF,0XFF,0XFF,0XFE,0XFC,0XFC,0XFF,0X1F,0X0F,0X00,
0X80,0XE0,0X80,0X00,0X00,0X00,0X00,0X00,0X80,0X80,0XC0,0XC0,0XC0,0X80,0X80,0X80,
0X00,0X00,0X00,0X00,0X00,0XE0,0XB0,0X00,};

const unsigned char role_level2_up[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X01,0X07,0X01,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X03,0X03,0X03,0X01,0X01,0X01,
0X00,0X00,0X00,0X00,0X00,0X07,0X0D,0X00,0X00,0XE0,0XF8,0X7F,0X3F,0X3F,0X7F,0XFF,
0XFF,0XFF,0XFF,0XFD,0XFD,0XFF,0XFF,0XFF,0XFF,0X7F,0X3F,0X3F,0XFF,0XF8,0XF0,0X00,
0X00,0X00,0X00,0X80,0XC0,0XC0,0X80,0XE0,0XD0,0XB0,0XB0,0XD8,0XF8,0XB8,0XB0,0XF0,
0XE0,0X80,0X80,0X80,0X00,0X00,0X00,0X00,};


const unsigned char role_level3_down[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X03,0X01,0X03,0X07,0X04,0X05,0X01,0X01,
0X01,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X10,0X0F,0X1F,0XFF,0X7F,0XBF,
0XDF,0X11,0X1E,0X0F,0X18,0X0E,0X4B,0X93,0XDF,0XBF,0X7F,0XFE,0X0F,0X07,0X00,0X00,
0X00,0X00,0X00,0XC0,0XE0,0X20,0X80,0X80,0XC0,0XA0,0XE0,0X60,0X60,0X60,0XE0,0XC0,
0X40,0XC0,0X80,0X60,0XE0,0XC0,0X00,0X00,};

const unsigned char role_level3_up[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X03,0X07,0X04,0X01,0X01,0X03,0X05,0X07,0X06,0X06,0X06,0X07,0X03,
0X02,0X03,0X01,0X06,0X07,0X03,0X00,0X00,0X00,0X00,0X08,0XF0,0XF8,0XFF,0XFE,0XFD,
0XFB,0X88,0X78,0XF0,0X18,0X70,0XD2,0XC9,0XFB,0XFD,0XFE,0X7F,0XF0,0XE0,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0XC0,0X80,0XC0,0XE0,0X20,0XA0,0X80,0X80,
0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,};

const unsigned char role_level4_down[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X07,0X0E,0X0F,0X07,0X0F,0X0F,0X0F,0X07,
0X03,0X03,0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X3F,0X7F,0X77,0XFD,0XF3,
0XEF,0XEF,0XFF,0XBB,0XBE,0XFD,0XFF,0XF7,0XFF,0XFF,0XFF,0XFF,0XFF,0X46,0X4C,0X00,
0X00,0X00,0X00,0X80,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XC0,0XE0,0XF0,0X70,0XF0,0XF8,
0XF0,0XF0,0X80,0X00,0X00,0X00,0X00,0XC0,};

const unsigned char role_level4_up[72] = { /* 0X12,0X01,0X00,0X18,0X00,0X18, */
0X00,0X00,0X00,0X01,0X03,0X03,0X03,0X03,0X03,0X03,0X03,0X07,0X0F,0X0E,0X0F,0X1F,
0X0F,0X0F,0X01,0X00,0X00,0X00,0X00,0X03,0X00,0X00,0X00,0XFC,0XFE,0XEE,0XBF,0XCF,
0XF7,0XF7,0XFF,0XDD,0X7D,0XBF,0XFF,0XEF,0XFF,0XFF,0XFF,0XFF,0XFF,0X62,0X32,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XC0,0XE0,0X70,0XF0,0XE0,0XF0,0XF0,0XF0,0XE0,
0XC0,0XC0,0X80,0X00,0X00,0X00,0X00,0X00,};

//30*31
const unsigned char achievement_cup[120] = { /* 0X12,0X01,0X00,0X1E,0X00,0X1F, */
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0XA0,0XA0,0XB0,0XA8,0XAE,0XA9,0XA8,0XA8,
0XA8,0XAE,0XA8,0XB0,0XA0,0XA0,0XE0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X01,0X01,0X02,0X06,0X05,0X05,0X05,0X07,0X06,0X0C,0XF0,0X10,0X10,0XF0,0X0C,
0X06,0X06,0X05,0X05,0X05,0X06,0X02,0X01,0X01,0X00,0X00,0X00,0X0F,0X20,0XDC,0XA0,
0X40,0X8F,0X20,0X40,0X80,0X00,0X00,0X03,0X3D,0X21,0X10,0X10,0X21,0X3D,0X03,0X00,
0X00,0X80,0X40,0X30,0X8F,0XC0,0XA0,0XDC,0X20,0X0F,0XE0,0X10,0X10,0X10,0X10,0XFE,
0X0A,0X0A,0X0A,0X0A,0X0A,0X0A,0X0A,0X0A,0XCA,0XCA,0X0A,0X0A,0X0A,0X0A,0X0A,0X0A,
0X0A,0X0A,0XFE,0X10,0X10,0X10,0X10,0XE0,};

//30*30
const unsigned char NPC2[120] = { /* 0X12,0X01,0X00,0X1E,0X00,0X1A, */
0X00,0X00,0X01,0X01,0X01,0X01,0X61,0X79,0X7F,0X7F,0X7F,0X7F,0X1F,0X1F,0X1F,0X1F,
0X1F,0X1F,0X1F,0X7F,0X7F,0X7F,0X79,0X61,0X61,0X01,0X01,0X01,0X00,0X00,0X00,0X00,
0XF0,0XF0,0XF0,0XF0,0XE7,0XDF,0XFF,0XFF,0XFF,0XFF,0XFF,0XEB,0XEB,0XEB,0XEB,0XFF,
0XF3,0XFF,0XFF,0XFF,0XDF,0XCF,0XE7,0XF0,0XF0,0XF0,0XE0,0X00,0X00,0X00,0X00,0X00,
0X00,0X0F,0X1F,0XFC,0XF8,0XF8,0X3C,0X3C,0XFE,0X7E,0XFE,0XFE,0X7E,0XFE,0X3E,0X3C,
0XF8,0XF8,0XFC,0XFF,0X1F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X80,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X80,0X80,0X80,0X00,0X00,0X00,0X00,0X00,};
//84*47
const unsigned char help1[504] =  { /* 0X12,0X01,0X00,0X54,0X00,0X2F, */
0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,0X03,
0X01,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X80,0X40,
0X20,0X20,0X20,0X20,0X20,0X20,0X20,0X3C,0X23,0X3C,0X27,0X20,0X20,0X20,0X20,0X60,
0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X7C,0X78,0X78,0X7C,0X1E,0X1E,0X08,0X00,0X01,0X02,0X03,0X01,
0X00,0X82,0XFA,0XF8,0XF9,0X00,0X00,0X00,0X04,0X1E,0X7E,0X7C,0X78,0X78,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0XC6,0X7C,0X88,0X78,
0X08,0X08,0X08,0X0C,0X06,0X03,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X18,0X1C,0X3C,0X1C,0X1C,0X1C,0X1C,0X00,0X00,0X0E,0X34,0XC8,
0X34,0XE3,0XE0,0X50,0XC8,0XCF,0XCF,0XC8,0X58,0XF0,0X63,0X24,0X00,0X00,0X1C,0X1C,
0X1C,0X1C,0X3E,0X1E,0X1C,0X08,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XE0,0X98,
0X06,0X02,0X03,0X01,0X01,0X01,0X01,0X03,0X06,0X0C,0XF0,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X0F,0X07,0X0F,0X1F,
0X3F,0X3C,0X10,0X00,0X00,0X00,0X80,0X00,0X67,0XC7,0XC7,0X60,0X00,0X80,0X00,0X00,
0X18,0X3C,0X1F,0X0F,0X0F,0X0F,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X04,0X03,0X00,0X00,0X02,0X04,0X04,0X03,
0X00,0X10,0X0E,0X02,0X00,0X00,0X04,0X05,0X02,0X00,0X03,0X04,0X00,0X07,0X00,0X01,
0X80,0X84,0X84,0X80,0X87,0X81,0X02,0X04,0X00,0X00,0X00,0X00,0XC0,0XE0,0XE0,0X80,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0XFE,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF0,0X00,0X00,
0XC0,0X40,0X40,0XC0,0X00,0XC0,0X00,0X00,0XC0,0X00,0XC0,0X00,0X40,0X00,0XE0,0X00,
0X00,0XD0,0X00,0X00,0X40,0X00,0X40,0X00,0XF0,0X00,0XC0,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,};

const unsigned char help2[498] = { /* 0X12,0X01,0X00,0X53,0X00,0X30, */
0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X01,
0X02,0X02,0X02,0X02,0X04,0X04,0X04,0X04,0X02,0X02,0X02,0X02,0X01,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X1C,0X30,0X40,
0X80,0X20,0X10,0X18,0X70,0X10,0XC0,0X00,0X00,0X00,0X00,0XC0,0X00,0X20,0X48,0X10,
0XA4,0XDD,0X69,0X30,0X0C,0X03,0X00,0X00,0X00,0X00,0X00,0X04,0X04,0X0E,0X0E,0X0F,
0X1F,0X1F,0X1F,0X3F,0X3F,0X7F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,
0X00,0X00,0X00,0X00,0X00,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,0X1F,
0X1F,0X00,0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XF8,
0X06,0X01,0X00,0X00,0X01,0X00,0X04,0X06,0X02,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X01,0X01,0X00,0X44,0X42,0X40,0X41,0X0E,0XF8,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X80,0X80,0X80,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X03,0X03,0X03,0X03,0X03,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X80,0XC0,0X40,0X20,0X90,0X90,0X48,0X48,0X48,0X68,0X68,0X68,
0X68,0XC8,0XC8,0XD0,0X90,0X10,0X20,0X40,0X80,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0X3C,0XFF,0XFF,0X7F,0X7E,
0X7E,0X3C,0X3C,0X1C,0X18,0X18,0X00,0X00,0X00,0X00,0X3C,0X3C,0X3C,0XFF,0XFF,0XFF,
0XFF,0XFF,0X3C,0X3C,0X3C,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,
0XC0,0XC0,0XC0,0XC0,0XC0,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0X00,0XFF,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,0X01,
0X01,0X01,};



#endif
